 


import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.Properties;

import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;


public class ILookintoServletContextListener implements ServletContextListener {
 
	public void contextDestroyed(ServletContextEvent arg0) {

	}

	public void contextInitialized(ServletContextEvent arg0) {
		System.out.println("Initialize servlet context with TGTServletContextListener");
		arg0.getServletContext().setAttribute("attrib", "valor");
		try
		{
			String pathToOtsConfig = arg0.getServletContext().getRealPath("/") + "WEB-INF/mycarserver.properties";
			Properties props = new Properties();
			FileInputStream in = null;
	        in = new FileInputStream(pathToOtsConfig);
	        props.load(in);
	        
			// Set up a log4j configuration file watcher
			 
	        
	
		} catch ( FileNotFoundException ex )
		{
			System.out.println("Unable to load properties from mycarserver.properties. File not found.");
		}
		catch ( IOException ix)
		{
			System.out.println("IO Exception trying to load from mycarserver.properties");
		}
	}
}
